#include "save_image.h"
//#include "spdlog/spdlog.h"
//#include "spdlog/sinks/stdout_color_sinks.h"
//#include "spdlog/sinks/stdout_sinks.h"
//#include "spdlog/sinks/basic_file_sink.h"
//#include "spdlog/sinks/rotating_file_sink.h"
//#include "spdlog/sinks/daily_file_sink.h"

//using namespace std;
//using namespace spdlog;
//std::shared_ptr<spdlog::logger> file_logger ;

using namespace cv;

SaveImageThread::SaveImageThread(QObject *parent)
{
    ;
}
SaveImageThread::~SaveImageThread()
{
    ;
}
void SaveImageThread::addImage(string image_name , HObject image)
 {
     pair<string,HObject> pair_obj;
     pair_obj.first = image_name;
     pair_obj.second= image;
     m_list.push_back(pair_obj);
 }

void SaveImageThread::run()
{
    while (1)
    {
        pair<string,HObject> pai_obj;
        if (false == m_list.get(pai_obj))
        {
          QThread::msleep(100);
          continue;
        }
        WriteImage(pai_obj.second,"png",0,pai_obj.first.c_str());
    }
}
